package com.xunyji.demo00testdemo.web.thymeleaf;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author AltEnter
 * @create 2019-01-12 14:26
 * @desc Hello控制层
 **/
@Controller
@RequestMapping(value = "/hello")
@Slf4j
public class HelloController {
    @GetMapping
    public String index (ModelMap map) {
        map.addAttribute("message", "https://www.cnblogs.com/NeverCtrl-C/");
        map.addAttribute("userName", "王杨帅");
        log.info("进入hello index");
        return "hello";
    }
    
    @GetMapping(value = "/login")
    public String login (ModelMap map) {
        log.info("login - 进入登录逻辑");
        return "login";
    }
}

